package com.wiscamp.ninechapters.problems.enums;

/**
 * 题集分类枚举
 */
public enum CollectionCategories {
    PRACTICE(148001, "课后练习"),

    UNIT_TEST(148002, "单元测试"),

    MONTHLY_TEST(148003, "月度测试"),

    QUARTERLY_TEST(148004, "季度测试"),

    MID_TERM_EXAM(148005, "期中考试"),

    TERMINAL_EXAM(148006, "期末考试"),

    MOCK_EXAM(148007, "模拟考试"),

    JUNIOR_SCHOOL_ENTRANCE_EXAM(148008, "小升初考试"),

    HIGH_SCHOOL_ENTRANCE_EXAM(148009, "中考"),

    COLLEGE_ENTRANCE_EXAM(148010, "高考"),

    SPECIAL_PRACTICE(148011, "专题汇编"),

    SYNC_TEST(148012, "同步测试"),

    ENTRANCE_EXAM(148013, "入学考试"),

    CHALLENGE(148014, "竞赛");

    private final int value;

    private final String name;

    CollectionCategories(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static CollectionCategories valueOf(int value) {
        return switch (value) {
            case 148001 -> CollectionCategories.PRACTICE;
            case 148002 -> CollectionCategories.UNIT_TEST;
            case 148003 -> CollectionCategories.MONTHLY_TEST;
            case 148004 -> CollectionCategories.QUARTERLY_TEST;
            case 148005 -> CollectionCategories.MID_TERM_EXAM;
            case 148006 -> CollectionCategories.TERMINAL_EXAM;
            case 148007 -> CollectionCategories.MOCK_EXAM;
            case 148008 -> CollectionCategories.JUNIOR_SCHOOL_ENTRANCE_EXAM;
            case 148009 -> CollectionCategories.HIGH_SCHOOL_ENTRANCE_EXAM;
            case 148010 -> CollectionCategories.COLLEGE_ENTRANCE_EXAM;
            case 148011 -> CollectionCategories.SPECIAL_PRACTICE;
            case 148012 -> CollectionCategories.SYNC_TEST;
            case 148013 -> CollectionCategories.ENTRANCE_EXAM;
            case 148014 -> CollectionCategories.CHALLENGE;
            default -> null;
        };
    }
}
